package game.buildings;

/**
 *	@(#)University.java
 *
 *	The <code>University</code> class represents the university building.
 *	A manned university activates all neighbouring faculties.
 *
 *	@author Grzegorz Kobiela
 *	@version 1.0 2008/4/14
 */
public final class University
extends MannableBuilding
implements Unique
{
	/** The neighbouring faculties. */
	private java.util.ArrayList<Faculty> faculties;

	/**
 	 *	Creates a new <code>University</code> instance.
	 */
	public University() {
		super(BuildingType.UNIVERSITY);
		faculties = new java.util.ArrayList<Faculty>();
		polygon = new java.awt.Polygon(new int[]{0, 2, 2, 0}, new int[]{0, 0, 2, 2}, 4);
		limitUsed = -1;
		spin = 1;
	}

	/**
	 *	Adds the given faculty.
	 *	@param faculty the faculty
	 */
	public void addFaculty(Faculty faculty) {
		faculty.setWorker(worker);
		faculties.add(faculty);
	}

	/**
	 *	Removes all faculties.
	 */
	public void removeFaculties() {
		for(Faculty faculty: faculties) faculty.setWorker(null);
		faculties.clear();
	}

	/**
	 *	Returns all neighbouring faculties.
	 *	@return all neighbouring faculties.
	 */
	public java.util.ArrayList<Faculty> getFaculties() {
		return faculties;
	}
}